
import React from 'react';
import * as type from './login.module.css'
import { Input } from 'antd';
class Login extends React.Component{
  constructor(){
    super()
    this.state={
      name:'root',
      passw: '',
    }
  }

  changestate = (val,e)=>{
    if(val === 'name'){
      this.setState({
        name: e.target.defaultValue
      })
    }else{
      this.setState({
        passw: e.target.defaultValue
      })
    }
  }

  msgtijiao = () => {
    console.log("this",this)
  }

  render(){

    return (
      <div className={type.login}>
        <div className={type['login-body']}>
          <div>系 统 登 录</div>

          <div>
            <Input addonBefore="用 户"  className={type['input-update']}  placeholder="请填写用户名" onBlur={this.changestate.bind(this,'name')}/>
          </div>
          <div>
            <Input addonBefore="密 码" className={type['input-update']} type="password" placeholder="请填写密码" onBlur={this.changestate.bind(this,'passw')}/>
          </div>
          <div onClick={this.msgtijiao}>登 录</div>

        </div>
      </div>
    )
  }
  componentDidUpdate(){
    console.log("componentDidUpdate")
  }
}

export default Login;